#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "insertthread.h"
#include "selectthread.h"
#include "otherthread.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public slots:
    void recvCurrentID_slot(int curID);

    void recvProgress_slot(int all, int valid, int upload);

private slots:
    void on_pBtn_change_clicked();

private:
    void initDatabase();

    void initSubThread();

    void initInsertThread();

    void initSelectThread();

    void initOtherThread();

private:
    QThread         *insertThread   = nullptr;
    InsertThread    *insertObj      = nullptr;

    QThread         *selectThread   = nullptr;
    SelectThread    *selectObj      = nullptr;

    QThread         *otherThread    = nullptr;
    OtherThread     *otherObj       = nullptr;

private:
    Ui::MainWindow *ui;

};
#endif // MAINWINDOW_H
